Field of the Invention
Embodiments of the present invention relate generally to computer graphics and, more specifically, to an improved technique for pre-computing ambient obscurance.
Description of the Related Art
Rendering realistic scenes for computer-generated films and games typically involves computing accurate global illumination for each object in the scene. This computed global illumination information results in an accurate portrayal of lighting and shadow information resulting from objects blocking ambient light sources and casting shadows on each other. Computing a complete global illumination model may be computationally intensive. As such, real-time performance with a full global illumination model is difficult to achieve, particularly on gaming consoles. Accordingly, approximation models have been developed that approximate a full global illumination model with reasonable accuracy. Computing such approximation models is less computationally intensive than computing a full global illumination model.
One such approximation model is ambient obscurance (AO), which models a uniformly lit scene where occluding objects block a portion of the light from surrounding objects. In the AO model, this occluding characteristic diminishes as a function of the distance between the occluding object and the occluded object. AO parameters may be pre-computed or “baked” in advance and attached to the vertices of the various polygons that form the objects in the scene. During playback, such as during the play of a computer-generated game sequence, these baked, per-vertex AO parameters are retrieved by a graphics processing unit (GPU) during the scene rendering process. The AO parameters are used to rapidly compute lighting information for each polygon with real-time performance.
One drawback to the above approach is that the memory consumed for storing these AO increases with scene complexity. For example, if a scene file includes 3,000 objects with 10,000 vertices per object, then storing four AO parameters per vertex would increase the memory storage of the scene by 4×3,000×10,000=120 million parameters. Another drawback to the above approach is that when a pre-baked AO model is applied to a dynamic object, the lighting is static and does not update as the object moves over time. As a result, the light and shadow cast on the dynamic object looks incorrect as the object moves.
Accordingly, what is needed in the art is a more effective approach to pre-computing ambient obscurance parameters.